<div class="projects_wrapper">
<?php
echo $sHeader;

if($qProjects->num_rows() > 0)
{
	$iCurrentYear = 0;
	
	for($i = 0; $i < $qProjects->num_rows(); $i++)
	{
		if($iCurrentYear != $qProjects->row($i)->project_date_year)
		{
		?>
	<div class="project_year">
		<?php echo $qProjects->row($i)->project_date_year; ?>
	</div>
		<?php
			$iCurrentYear = $qProjects->row($i)->project_date_year;
		}
		
		$month_text = date("F", mktime(0, 0, 0, $qProjects->row($i)->project_date_month, 0, 0, 0));
	?>
	<div class="project_wrapper">
		<div class="title"><?php echo $qProjects->row($i)->project_title; ?></div>
		<div class="date"><?php echo $month_text." ".$qProjects->row($i)->project_date_year; ?></div>
		<div class="description"><?php echo $qProjects->row($i)->project_desc; ?></div>
		<div class="image"><img src="/assets/media/project_thumbs/<?php echo $qProjects->row($i)->jpg_media_subfolder; ?>/<?php echo $qProjects->row($i)->jpg_media_id; ?>.<?php echo $qProjects->row($i)->jpg_extension_ext; ?>" /></div>
		<div class="links">
			<a class="project_preview" href="/assets/media/original/<?php echo $qProjects->row($i)->jpg_media_subfolder; ?>/<?php echo $qProjects->row($i)->jpg_media_id; ?>.<?php echo $qProjects->row($i)->jpg_extension_ext; ?>">View</a> 
			<span class="download">
				Download 
				<?php
				if($qProjects->row($i)->pdf_media_id > 0)
				{
				?>
				<a href="/assets/media/web/<?php echo $qProjects->row($i)->pdf_media_subfolder; ?>/<?php echo $qProjects->row($i)->pdf_media_id; ?>.<?php echo $qProjects->row($i)->pdf_extension_ext; ?>" target="_blank">pdf</a> 
				<?php
				}
				?>
				<a href="/assets/media/original/<?php echo $qProjects->row($i)->jpg_media_subfolder; ?>/<?php echo $qProjects->row($i)->jpg_media_id; ?>.<?php echo $qProjects->row($i)->jpg_extension_ext; ?>" target="_blank">jpg</a> 
				<a href="/project/zip/<?php echo $qProjects->row($i)->project_id; ?>" target="_blank">zip</a>
			</span>
		</div>
		<div class="clear"><!-- --></div>
	</div>
	<?php
	}
}
?>
</div>